package com.ty.dao;

import java.util.List;

import cn.smart.core.annotation.PageX;
import com.ty.entity.InventoryQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.data.domain.Pageable;
import com.ty.entity.Inventory;

 /**
 * 库存表;(212_inventory)表数据库访问层
 * @author : heimi
 * @date : 2025-6-9
 */
@Mapper
public interface InventoryDao{
    @PageX
    List<Inventory> select(InventoryQuery query);
    Integer insert(Inventory inventory);
    Integer insertBatch(List<Inventory> inventorys);
    Integer update(Inventory inventory);
    Integer delete(Integer id);

    @Update("update `212_inventory` set qty =qty + #{optionQty},version = version +1 where id = #{id} ")
    Integer upadeteQty(Integer id, Integer optionQty);
}